package com.carlinfo.users.pojo;

import java.util.Date;

/**
 * 用户表的POJO
 */
public class AUsers {

    private int id;
    private int regionId;
    private String email;
    private String password;
    private String photoPath;
    private String nickName;
    private String phone;
    private String qq;
    private int loginFailedCount;
    private Date loginFailedTime;
    private int loginCount;
    private String lastLoginIp;
    private String address;
    private String instro;
    private byte emailStatus;
    private byte photoStatus;
    private byte bodyType;
    private byte status;
    private Date createTime;
    private Date updateTime;
    private Date pubTime;
    private Date lastloginTime;

    // 状态的字符串描述
    private String statusStr;
    private String emailStatusStr;
    private String photoStatusStr;
    private String bodyTypeStr;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getRegionId() {
        return regionId;
    }

    public void setRegionId(int regionId) {
        this.regionId = regionId;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPhotoPath() {
        return photoPath;
    }

    public void setPhotoPath(String photoPath) {
        this.photoPath = photoPath;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq;
    }

    public int getLoginFailedCount() {
        return loginFailedCount;
    }

    public void setLoginFailedCount(int loginFailedCount) {
        this.loginFailedCount = loginFailedCount;
    }

    public Date getLoginFailedTime() {
        return loginFailedTime;
    }

    public void setLoginFailedTime(Date loginFailedTime) {
        this.loginFailedTime = loginFailedTime;
    }

    public int getLoginCount() {
        return loginCount;
    }

    public void setLoginCount(int loginCount) {
        this.loginCount = loginCount;
    }

    public String getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getInstro() {
        return instro;
    }

    public void setInstro(String instro) {
        this.instro = instro;
    }

    public byte getEmailStatus() {
        return emailStatus;
    }

    public void setEmailStatus(byte emailStatus) {
        this.emailStatus = emailStatus;
    }

    public byte getPhotoStatus() {
        return photoStatus;
    }

    public void setPhotoStatus(byte photoStatus) {
        this.photoStatus = photoStatus;
    }

    public byte getBodyType() {
        return bodyType;
    }

    public void setBodyType(byte bodyType) {
        this.bodyType = bodyType;
    }

    public byte getStatus() {
        return status;
    }

    public void setStatus(byte status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getPubTime() {
        return pubTime;
    }

    public void setPubTime(Date pubTime) {
        this.pubTime = pubTime;
    }

    public Date getLastloginTime() {
        return lastloginTime;
    }

    public void setLastloginTime(Date lastloginTime) {
        this.lastloginTime = lastloginTime;
    }

    public String getStatusStr() {
        AUsersEnum[] usersEnums = AUsersEnum.values();
        for (int i = 0; i < usersEnums.length; i++) {
            AUsersEnum usersEnum = usersEnums[i];
            if (usersEnum.toString().startsWith("STATUS")) {
                if (this.getStatus() == usersEnum.getStatus()) {
                    this.statusStr = usersEnum.getName();
                }
            }
        }
        return statusStr;
    }

    public String getEmailStatusStr() {
        AUsersEnum[] usersEnums = AUsersEnum.values();
        for (int i = 0; i < usersEnums.length; i++) {
            AUsersEnum usersEnum = usersEnums[i];
            if (usersEnum.toString().startsWith("EMAIL_STATUS_")) {
                if (this.emailStatus == usersEnum.getStatus()) {
                    this.emailStatusStr = usersEnum.getName();
                }
            }
        }
        return emailStatusStr;
    }

    public String getPhotoStatusStr() {
        AUsersEnum[] usersEnums = AUsersEnum.values();
        for (int i = 0; i < usersEnums.length; i++) {
            AUsersEnum usersEnum = usersEnums[i];
            if (usersEnum.toString().startsWith("PHONE_STATUS_")) {
                if (this.photoStatus == usersEnum.getStatus()) {
                    this.photoStatusStr = usersEnum.getName();
                }
            }
        }
        return photoStatusStr;
    }

    public String getBodyTypeStr() {
        AUsersEnum[] usersEnums = AUsersEnum.values();
        for (int i = 0; i < usersEnums.length; i++) {
            AUsersEnum usersEnum = usersEnums[i];
            if (usersEnum.toString().startsWith("BODY_TYPE_")) {
                if (this.bodyType == usersEnum.getStatus()) {
                    this.bodyTypeStr = usersEnum.getName();
                }
            }
        }
        return bodyTypeStr;
    }
}


